// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'

import ElementUI from 'element-ui'
// 引入elementui
import 'element-ui/lib/theme-chalk/index.css'
// 注册全局的组件
import ComponentJs from './components/common-component'
import MyTestInput from 'vue-demo-one'

// 手动配置View UI
// 1. 引入库
import ViewUI from 'view-design'
// 2. 引入样式
import 'view-design/dist/styles/iview.css'

// 引用axios，并设置基础URL为后端服务api地址
var axios = require('axios')
// 配置后端的访问地址
// axios.defaults.baseURL = 'http://localhost:8800/'
axios.defaults.baseURL = '/api'

axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8'
// 将API方法绑定到全局
Vue.prototype.$axios = axios

// 3. 生效
Vue.use(ViewUI)
Vue.use(ComponentJs)
Vue.use(ElementUI)
Vue.use(MyTestInput)

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
